package tech.edwardvan.cloudb.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;
import tech.edwardvan.cloudapib.client.CloudBClient;
import tech.edwardvan.cloudapib.entity.Message;
import tech.edwardvan.cloudcommon.entity.ServerResponse;

/**
 * 业务B Controller
 *
 * @author EdwardVan
 */
@RestController
@Slf4j
public class CloudBController implements CloudBClient {

    @Override
    public ServerResponse<Message> receive(Message message) {
        log.info("cloud-b收到消息:{}", message.getContent());
        message.setReceipt("cloud-b成功收到消息");
        return ServerResponse.success(message);
    }

}
